home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_kdelibs.idb / usr / freeware / kde / include / kpreview.h.z / kpreview.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  2.4 KB  |  86 lines

  1. // -*- c++ -*-
  2. /* This file is part of the KDE libraries
  3.     Copyright (C) 1997, 1998 Daniel Grana <grana@ie.iwi.unibe.ch>
  4.                   1998 Stephan Kulow <coolo@kde.org>
  5.     
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.  
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU Library General Public License
  17.     along with this library; see the file COPYING.LIB.  If not, write to
  18.     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.     Boston, MA 02111-1307, USA.
  20. */
  21.  
  22. #ifndef __KPREVIEW_H__
  23. #define __KPREVIEW_H__
  24.  
  25. #include <qpixmap.h>
  26. #include <qgrpbox.h>
  27. #include <qlabel.h>
  28. #include <qmlined.h>
  29. #include <qdict.h>
  30.  
  31. #include "kfileinfo.h"
  32. #include "kdir.h"
  33. #include "kfiledialog.h"
  34.  
  35. class KPreviewObject;
  36. /**
  37.  * The KPreview widget displays previews of a file. Two possible previews 
  38.  * are possible, either some text or a pixmap.
  39.  *
  40.  * The widget has been designed to allow the uses to easily add new
  41.  * custom preview modules. For that use the static method 
  42.  * KPreview::registerPreviewModule.
  43.  *
  44.  * @short A file preview widget
  45.  *
  46.  * @author Daniel Grana grana@ie.iwi.unibe.ch
  47.  *
  48.  * @version $Id: kpreview.h,v 1.3 1998/04/16 08:54:14 grana Exp $
  49.  */
  50. class KPreview : public QWidget {
  51.  
  52.     Q_OBJECT
  53.     
  54. public:
  55.  
  56.     KPreview( const KDir *inDir= 0, QWidget *parent= 0, const char *name= 0);
  57.     //static KPreview *getKPreview(KDir *inDir, QWidget *parent= 0, const char *name= 0);
  58.     //static KPreview *getKPreview();
  59.     virtual ~KPreview(); 
  60.     
  61. public:
  62.     static void registerPreviewModule( const char * format, PreviewHandler readPreview,
  63.                                        PreviewType inType);
  64.     
  65. public slots:
  66.     virtual void previewFile(const KFileInfo *i);
  67.  
  68. private:
  69.     QLabel *myName;
  70.     QLabel *mySize;
  71.     QLabel *myDate;
  72.     QLabel *myOwner;
  73.     QLabel *myGroup;
  74.     QLabel *myType;
  75.     QLabel *myPreviewPicture;
  76.     QMultiLineEdit *myPreviewText;
  77.     QGroupBox *myBox;
  78.     const KDir *myDir;
  79.     bool showedText;
  80.  
  81.     KPreview *_myKPreview;    
  82.  
  83. };
  84.  
  85. #endif
  86.